#include <iostream>
#include <cstring>
using namespace std;

class Cal
{
	public :
		int m_x;
		int m_y;
		string m_op;
	public :
		Cal(int x = 1, int y = 2, string op = "+") :
			m_x(x), m_y(y), m_op(op)
		{}

		friend int get_result(const Cal& c);

	protected :
};

int get_result(const Cal& c)
{
/*
	switch(c.m_op)
	{
		case "+" : return (c.m_x + c.m_y);
		case "-" : return (c.m_x - c.m_y);
		case "*" : return (c.m_x * c.m_y);
		case "/" : 
				   if(c.m_y != 0)
				   {
					   return (c.m_x / c.m_y);
				   }
				   else
				   {
					   return -1;
				   }
	}
*/
	if(c.m_op == "+")
	{
		return (c.m_x + c.m_y);
	}
	else if(c.m_op == "-")
	{
		return (c.m_x - c.m_y);
	}
	else if(c.m_op == "*")
	{
		return (c.m_x * c.m_y);
	}
	else if(c.m_op == "/")
	{
		if(c.m_y != 0)
		{
			return (c.m_x / c.m_y);
		}
		else 
		{
			return -1;
		}
	}
}

int main()
{
	Cal c1(4, 2, "/");
	Cal c2(1, 4, "+");
	Cal c3(4, 5, "-");
	Cal c4(5, 6, "*");

	if(get_result(c1) != -1)
	{
		cout << c1.m_x << " " << c1.m_op << " " << c1.m_y << " = " << get_result(c1) << endl;
	}
	else
	{
		cout << "Division is error !" << endl;
	}

	cout << c2.m_x << " " << c2.m_op << " " << c2.m_y << " = " << get_result(c2) << endl;
	cout << c3.m_x << " " << c3.m_op << " " << c3.m_y << " = " << get_result(c3) << endl;
	cout << c4.m_x << " " << c4.m_op << " " << c4.m_y << " = " << get_result(c4) << endl;
}
